<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>06.class创建对象.html</title>
</head>
<body>
    <script>
        // 创建学生对象
        class Student {
            name="小明";
            say=function() {
                console.log(this.name);

            }
            eat=() => {
                console.log(this.name);
            }
            sleep() {
                
            }
            static add() {

            }
        }

        // Student.prototype.sleep = function() {

        // }
        // Student.add = function() {}

        const stu = new Student();
        stu.say()
        stu.eat
        console.dir(stu);
        console.dir(Student);

        class Teacher {
     
            constructor(id,name,age) {
                this.id = id;
                this.name = name;
                this.age =age;
                this.say = function() {

                }
            }
            say() {
                
            }

        }

        const tea = new Teacher(1001,"李老师",30);
        console.log(tea);
    </script>
    
</body>
</html>